home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 2
/
SPACE - Library 2 - Volume 1.iso
/
apps
/
102
/
examples
/
exshift.c
< prev
next >
Wrap
C/C++ Source or Header
|
1987-01-25
|
2KB
|
36 lines
/* p317 MW 'C' Oct'86 CJPurcell : use to show status of shift keys,etc. */
#include <osbind.h> /* use X to exit */
main() {
char key;
long shifts;
Cconws(" test shift keys; press X to exit back to calling program.\r\n");
while((key = Cconin()) != 'X') {
shifts = Getshift(-1);
if(key < 0x20) {
Cconout('^');
key += 40;
}
else
Cconout(' ');
Cconout( key );
if(shifts & 0x01) /* right shift down */
Cconws("[RShift]");
if(shifts & 0x02) /* left shift down */
Cconws("[LShift]");
if(shifts & 0x04) /* Control key down */
Cconws("[Control]");
if(shifts & 0x08) /* Alternate key down */
Cconws("[Alt_Key]");
if(shifts & 0x10) /* Caps lock on */
Cconws("[Caps_Lock]");
/* if(shifts & 0x20) */ /* Right mouse button */
/* Cconws("[RMouse]"); */ /* or (CLR/HOME) */
/* if(shifts & 0x40) */ /* Right mouse button */
/* Cconws("[LMouse]"); */ /* or (INSERT) */
/* apparently, these last two functions are not now in TOSROM */
Cconws("\r\n"); /* cr/lf at end of line */
}
}